import request from "@/utils/request";

// 请求角色管理的 api
export const asyncGetRoleList = (page, limit, data) => request.get(`/admin/acl/role/${page}/${limit}`, {
    params: {
        roleName: data
    }
});

// 添加角色管理的 api
export const asyncAddRole = (roleName) => request.post(`/admin/acl/role/save`, {
    roleName
},);

// 修改角色的 api
export const asyncUpDataRole = (data) => request.put(`/admin/acl/role/update`, data);

//删除角色的 api
export const asyncDeleteRole = (id) => request.delete(`/admin/acl/role/remove/${id}`);

// 根据角色获取权限列表
export const asyncGetAssignList = (roleId) => request.get(`/admin/acl/permission/toAssign/${roleId}`);

// 根据角色分配权限
export const asynCallotJurisdiction = (roleId,permissionId) => request.post(`/admin/acl/permission/doAssign?roleId=${roleId}&permissionId=${permissionId}`,);
